<div class="box grid_8 round_all" style="width:60%">
	<h2 class="box_head grad_colour">Duyệt tin bài</h2>
	<a href="#" class="grabber">&nbsp;</a>
	<a href="#" class="toggle">&nbsp;</a>
	<div class="toggle_container">
		<div class="block">
			<form id="editMenu"method="POST" action="">
				<label>Ngôn ngữ</label>
				<div class="input_group">
					<select name="ngonngu">
						<?php
                            foreach($ngonngu as $row)
                            {
                                $id=$row['id_ngonngu'];
                                $language=$row['ngonngu'];
                                echo "<option value=$id>$language
						              </option>";
                            }
                        ?>
					</select>
				</div>
				{dt}
				
				<label>Tên menu</label> 
				<input id="notempty" name="tenmenu"title="Nhập tên menu" type="text" class="large" value="{title}" autofocus> 
				<input type="hidden" name="id" value="{id}"/>
				<label>Loại menu</label>
				<div class="input_group">
					<select name="loaimenu">
						<option value="trongnuoc">
							Trang chủ
						</option>
						<option value="trongnuoc">
							Quảng cáo
						</option>
						<option value="quocte">
							Liên hệ
						</option>
						<option value="xahoi">
							Cấp tin tức
						</option>
						<option value="xahoi">
							Cấp video
						</option>
					</select>
				</div>
				
				<label>Thuộc menu</label>
				<div class="input_group">
					<select name="menucha">
						<option value="0">
							Menu gốc
						</option>
						<?php 
                        foreach($menu as $row)
                        {
                            $id=$row['id_menu'];
                            $name=$row['ten_menu'];
                            if($id==$dt['0']['id_cha']) $select="selected='selected'"; else $select="";
                            echo "<option value='$id' $select>$name</option>";
                        }
                        ?>
					</select>
				</div>
				<table>
                <td>
                    <button onclick="submitForm('updateMenu','Bạn có muốn sửa menu này?')"class="button_colour round_all"><?php echo img(array('src' => 'images/icons/small/white/Bended%20Arrow%20Right.png' , 'height' => '24' , 'width' => '24' , 'alt' => 'Bended Arrow Right')) ?><span>Sửa menu</span></button>
                </td>
                <td>
                    <td><button onclick="submitForm('transMenu','Bạn có muốn dịch menu?')"class="button_colour round_all"><?php echo img(array('src' => 'images/icons/small/white/Bended%20Arrow%20Right.png' , 'height' => '24' , 'width' => '24' , 'alt' => 'Bended Arrow Right')) ?><span>Dịch menu</span></button></td>
                </td>
                </table> 							
				{/dt}
			</form>
			
			<script type="text/javascript"> 
	            var notempty = new LiveValidation('notempty');
				notempty.add( Validate.Presence );
                notempty.add( Validate.Length, { minimum: 5 } );
				var atleast = new LiveValidation('atleast');
				atleast.add( Validate.Length, { minimum: 5 } );
                function submitForm(buttonID, message){
                var form;
                form=document.getElementById('editMenu');
                 if(buttonID!='updateMenu') 
                 {
                 if(confirm(message))
                  form.action= '<?php $id_menu=$dt['0']['id']; echo site_url("menu/doCreateMenu/$id_mark/$id_menu") ?>';
                  form.submit;
                  alert(form.action);
                 }
                 else 
                 {
                 if(confirm(message))  
                  form.action='<?php echo site_url("menu/doEditMenu")?>';
                  form.submit;
                  alert(form.action);  
                 }    
                }
			</script>
		</div>
	</div>
</div>